package com.rd.student.jiaji.class1.wangyufang.day0731;

import java.util.ArrayList;

public class TestRandom {
    public static void main(String[] args) {

        ArrayList<Integer> arrayList = new ArrayList<>(20);
            while(arrayList.size()<20){
                int n = (int)(Math.random()*50);

                if (!arrayList.contains(n)){
                    arrayList.add(n);
                }
            }
            System.out.println(arrayList);
        }
}
